TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file SeriesPointer.php

Documentation is available at SeriesPointer.php

  1. <?php
  2.  
  3. /**
  4.   *
  5.   * <p>Title: SeriesPointer class</p>
  6.   *
  7.   * <p>Description: Some Series have a Pointer method which returns a
  8.   * SeriesPointer class. Pointers are shape figures drawn on each Y point
  9.   * coordinate.</p>
  10.   *
  11.   * <p>Copyright (c) 2005-2008 by Steema Software SL. All Rights
  12.   * Reserved.</p>
  13.   *
  14.   * <p>Company: Steema Software SL</p>
  15.   *
  16.   */
  17.  
  18.  class SeriesPointer extends TeeBase {
  19.  
  20.     private $dark3D = true;
  21.     private $inflate = true;
  22.     private $horizSize = 4;
  23.     private $vertSize = 4;
  24.     private $style = 0;
  25.     private $pen=null;
  26.     private $bBrush=null;
  27.     private $xMinus, $xPlus, $yMinus, $yPlus;
  28.     private $series=null;
  29.  
  30.     protected $bVisible = true;
  31.     protected $defaultVisible=true;
  32.     protected $allowChangeSize=true;
  33.     protected $draw3D = true;
  34.  
  35.     // Class Definition
  36.  
  37.     // Interceptors
  38.     function __get( $property ) {
  39.       $method ="get{$property}";
  40.       if ( method_exists( $this, $method ) ) {
  41.         return $this->$method();
  42.       }
  43.     }
  44.  
  45.     function __set ( $property,$value ) {
  46.       $method ="set{$property}";
  47.       if ( method_exists( $this, $method ) ) {
  48.         return $this->$method($value);
  49.       }
  50.     }
  51.  
  52.     // Constructor
  53.     public function SeriesPointer($c, $s) {
  54.         $this->style = PointerStyle::$RECTANGLE;
  55.  
  56.         parent::__construct($c);
  57.  
  58.         $this->readResolve();
  59.         $this->series = $s;
  60.     }
  61.  
  62.     public function assign($source) {
  63.         if ($source->bBrush != null) {
  64.             $this->getBrush()->assign($source->bBrush);
  65.         }
  66.         if ($source->pen != null) {
  67.             $this->getPen()->assign($source->pen);
  68.         }
  69.  
  70.         $this->style = $source->style;
  71.         $this->vertSize = $source->vertSize;
  72.         $this->horizSize = $source->horizSize;
  73.         $this->dark3D = $source->dark3D;
  74.         $this->draw3D = $source->draw3D;
  75.         $this->inflate = $source->inflate;
  76.         $this->bVisible = $source->bVisible;
  77.         $this->allowChangeSize = $source->allowChangeSize;
  78.         $this->defaultVisible = $source->defaultVisible;
  79.     }
  80.  
  81.     protected function readResolve() {
  82.         $this->defaultVisible = true;
  83.         return $this;
  84.     }
  85.  
  86.         /**
  87.           * Fills pointer sides in 3D mode with darker color.<br>
  88.           * Default value: true
  89.           *
  90.           * @return boolean 
  91.           */
  92.     public function getDark3D() {
  93.         return $this->dark3D;
  94.     }
  95.  
  96.         /**
  97.           * Fills pointer sides in 3D mode with darker color.<br>
  98.           * Default value: true
  99.           *
  100.           * @param value boolean
  101.           */
  102.     public function setDark3D($value) {
  103.         $this->dark3D = $this->setBooleanProperty($this->dark3D, $value);
  104.     }
  105.  
  106.         /**
  107.           * Draws pointer in 3D mode.<br>
  108.           * Currently only rectangle points have 3D capability. <br>
  109.           * Default value: true
  110.           *
  111.           * @return boolean 
  112.           */
  113.     public function getDraw3D() {
  114.         return $this->draw3D;
  115.     }
  116.  
  117.         /**
  118.           * Draws pointer in 3D mode.<br>
  119.           * Default value: true
  120.           *
  121.           * @param value boolean
  122.           */
  123.     public function setDraw3D($value) {
  124.         $this->draw3D = $this->setBooleanProperty($this->draw3D, $value);
  125.     }
  126.  
  127.         /**
  128.           * Shows or hides the pointer.<br>
  129.           * When using a Points series (or any Series class derived from Points
  130.           * series), setting Visible to false will not display anything. <br>
  131.           * Pointers can be useful with Line series or Area series. <br>
  132.           * When points are Visible, extra margins are applied to the four chart
  133.           * axes (Left, Right, Top and Bottom). This is to make points just at axis
  134.           * limits to be shown. <br>
  135.           * You can deactivate these extra margins by setting
  136.           * IPointer.InflateMargins to false. <br><br>
  137.           * Points are filled using IPointer.Brush.
  138.           *
  139.           * @return boolean 
  140.           */
  141.     public function getVisible() {
  142.         return $this->bVisible;
  143.     }
  144.  
  145.         /**
  146.           * Shows or hides the pointer.<br>
  147.           *
  148.           * @param value boolean
  149.           */
  150.     public function setVisible($value) {
  151.         $this->bVisible = $this->setBooleanProperty($this->bVisible, $value);
  152.     }
  153.  
  154.         /**
  155.           * Horizontal size of pointer in pixels.<br>
  156.           * Series that derive from Points series usually override the HorizSize
  157.           * and VertSize methods. <br>
  158.           * For example, Bubble series uses the Radius method to determine the
  159.           * correct HorizSize and VertSize, so these methods have no effect in
  160.           * that Series. <br>
  161.           * Default value: 4
  162.           *
  163.           * @return int 
  164.           */
  165.     public function getHorizSize() {
  166.         return $this->horizSize;
  167.     }
  168.  
  169.         /**
  170.           * Horizontal size of pointer in pixels.<br>
  171.           * Default value: 4
  172.           *
  173.           * @param value int
  174.           */
  175.     public function setHorizSize($value) {
  176.         $this->horizSize = $this->setIntegerProperty($this->horizSize, $value);
  177.     }
  178.  
  179.         /**
  180.           * Expands axes to fit pointers.<br>
  181.           * When false, Chart Axis scales will be preserved and points close to the
  182.           * Axis limits will be partially displayed. <br>
  183.           * Default value: true
  184.           *
  185.           * @return boolean 
  186.           */
  187.     public function getInflateMargins() {
  188.         return $this->inflate;
  189.     }
  190.  
  191.         /**
  192.           * Expands axes to fit pointers.<br>
  193.           * Default value: true
  194.           *
  195.           * @param value boolean
  196.           */
  197.     public function setInflateMargins($value) {
  198.         $this->inflate = $this->setBooleanProperty($this->inflate, $value);
  199.     }
  200.  
  201.         /**
  202.           * The Pointer style.<br>
  203.           * It defines the shape used to display the Series Points.<br>
  204.           * The default Rectangle style can be optionally in 3D mode by setting
  205.           * Pointer.Draw3D to true. <br>
  206.           * Series Pointer.Visible should be true.<br>
  207.           * Default value: rectangle
  208.           *
  209.           *
  210.           * @return PointerStyle 
  211.           */
  212.     public function getStyle() {
  213.         return $this->style;
  214.     }
  215.  
  216.         /**
  217.           * Sets the Pointer style.<br>
  218.           * Default value: rectangle
  219.           *
  220.           *
  221.           * @param value PointerStyle
  222.           */
  223.     public function setStyle($value) {
  224.         if ($this->style != $value) {
  225.             $this->style = $value;
  226.             $this->invalidate();
  227.         }
  228.     }
  229.  
  230.         //[Browsable(false)]
  231.     public function getSeries() {
  232.         return $this->series;
  233.     }
  234.  
  235.         /**
  236.           * The Horizontal size of pointer in pixels.<br>
  237.           * Series that derive from PointSeries usually override the HorizontalSize
  238.           * and VerticalSize methods. <br>
  239.           * For example, Bubble series uses the Radius property to determine the
  240.           * correct HorizSize and VertSize, so these methods have no effect in
  241.           * that Series. <br>
  242.           * Default value: 4
  243.           *
  244.           * @return int 
  245.           */
  246.     public function getVertSize() {
  247.         return $this->vertSize;
  248.     }
  249.  
  250.         /**
  251.           * Sets Horizontal size of pointer in pixels.<br>
  252.           * Default value: 4
  253.           *
  254.           * @param value int
  255.           */
  256.     public function setVertSize($value) {
  257.         $this->vertSize = $this->setIntegerProperty($this->vertSize, $value);
  258.     }
  259.  
  260.         /**
  261.           * The Percent of semiglass effect.<br>
  262.           * Default valuie: 0
  263.           *
  264.           * @return int 
  265.           */
  266.     public function getTransparency() {
  267.         return $this->getBrush()->getTransparency();
  268.     }
  269.  
  270.         /**
  271.           * Sets Percent of semiglass effect.<br>
  272.           * Default valuie: 0
  273.           *
  274.           * <p>Example:
  275.           * <pre><font face="Courier" size="4">
  276.           * bubbleSeries.getPointer().setTransparency(50); // -- 50 %
  277.           * </font></pre></p>
  278.           *
  279.           * @param value int
  280.           */
  281.     public function setTransparency($value) {
  282.         $this->getBrush()->setTransparency($value);
  283.     }
  284.  
  285.         /**
  286.           * Configures Gradient filling attributes.<br>
  287.           * Default value: null
  288.           *
  289.           * <p>Example:
  290.           * <pre><font face="Courier" size="4">
  291.           *   bubbleSeries.getPointer().getGradient().setVisible(true);
  292.           * </font></pre></p>
  293.           *
  294.           * @return Gradient 
  295.           */
  296.     public function getGradient() {
  297.         return $this->getBrush()->getGradient();
  298.     }
  299.  
  300.     private function drawDiagonalCross($g, $is3D, $colorValue) {
  301.         //g.AssignVisiblePenColor(Pen,ColorValue);
  302.         if ($is3D) {
  303.             $g->line($this->xMinus, $this->yMinus, $this->xPlus + 1, $this->yPlus + 1, $this->getStartZ());
  304.             $g->line($this->xPlus, $this->yMinus, $this->xMinus - 1, $this->yPlus + 1, $this->getStartZ());
  305.         } else {
  306.             $g->line($this->xMinus, $this->yMinus, $this->xPlus + 1, $this->yPlus + 1);
  307.             $g->line($this->xPlus, $this->yMinus, $this->xMinus - 1, $this->yPlus + 1);
  308.         }
  309.     }
  310.  
  311.     private function drawCross($g, $is3D, $px, $py, $colorValue) {
  312.         //g.AssignVisiblePenColor(Pen,ColorValue);      
  313.         if ($is3D) {
  314.             $g->verticalLine($px, $this->yMinus, $this->yPlus + 1, $this->getStartZ());
  315.             $g->horizontalLine($this->xMinus, $this->xPlus + 1, $py, $this->getStartZ());
  316.         } else {
  317.             $g->verticalLine($px, $this->yMinus, $this->yPlus + 1);
  318.             $g->horizontalLine($this->xMinus, $this->xPlus + 1, $py);
  319.         }
  320.     }
  321.  
  322.     private function doTriangle3D($g, $deltaY, $px, $py) {
  323.         if ($this->draw3D) {
  324.             $g->pyramid(true, $this->xMinus, $py - $deltaY, $this->xPlus, $py + $deltaY,
  325.                       $this->getStartZ(),
  326.                       $this->getEndZ(), $this->dark3D);
  327.         } else {
  328.             $g->triangle(new TeePoint($this->xMinus, $py + $deltaY),
  329.                        new TeePoint($this->xPlus, $py + $deltaY),
  330.                        new TeePoint($px, $py - $deltaY), $this->getStartZ());
  331.         }
  332.     }
  333.  
  334.     private function doHorizTriangle3D($g, $deltaX, $px, $py) {
  335.         if ($this->draw3D) {
  336.             $g->pyramid(false, $px + $deltaX, $this->yMinus, $px - $deltaX, $this->yPlus,
  337.                       $this->getStartZ(),
  338.                       $this->getEndZ(), $this->dark3D);
  339.         } else {
  340.             $g->triangle(new TeePoint($px + $deltaX, $this->yMinus),
  341.                        new TeePoint($px + $deltaX, $this->yPlus),
  342.                        new TeePoint($px - $deltaX, $py), $this->getStartZ());
  343.         }
  344.     }
  345.  
  346.         /**
  347.           * For internal use.
  348.           *
  349.           * @return int 
  350.           */
  351.     public function getStartZ() {
  352.         if ($this->series != null) {
  353.             return $this->series->getStartZ();
  354.         } else {
  355.             return 0;
  356.         }
  357.     }
  358.  
  359.         /**
  360.           * For internal use.
  361.           *
  362.           * @return int 
  363.           */
  364.     public function getMiddleZ() {
  365.         if ($this->series != null) {
  366.             return $this->series->getMiddleZ();
  367.         } else {
  368.             return 0;
  369.         }
  370.     }
  371.  
  372.         /**
  373.           * For internal use.
  374.           *
  375.           * @return int 
  376.           */
  377.     public function getEndZ() {
  378.         if ($this->series != null) {
  379.             return $this->series->getEndZ();
  380.         } else {
  381.             return 0;
  382.         }
  383.     }
  384.  
  385.         /**
  386.           * The pointer color.
  387.           *
  388.           * @return Color 
  389.           */
  390.     public function getColor() {
  391.         return $this->getBrush()->getColor();
  392.     }
  393.  
  394.         /**
  395.           * Sets the pointer color.
  396.           *
  397.           * @param value Color
  398.           */
  399.     public function setColor($value) {
  400.         $this->getBrush()->setColor($value);
  401.     }
  402.  
  403.     public function setChart($c) {
  404.         parent::setChart($c);
  405.         if ($this->pen != null) {
  406.             $this->pen->setChart($c);
  407.         }
  408.         if ($this->bBrush != null) {
  409.             $this->bBrush->setChart($c);
  410.         }
  411.     }
  412.  
  413.         /**
  414.           * Internal use. Draw Pointer
  415.           *
  416.           *
  417.           * @param g IGraphics3D
  418.           * @param is3D boolean
  419.           * @param px int
  420.           * @param py int
  421.           * @param tmpHoriz int
  422.           * @param tmpVert int
  423.           * @param colorValue Color
  424.           * @param aStyle PointerStyle
  425.           */
  426.     public function intDraw($g, $is3D, $px, $py, $tmpHoriz,$tmpVert,
  427.                                   $colorValue, $aStyle=0) {
  428.  
  429.         $old_name = TChart::$controlName;
  430.         TChart::$controlName .= 'SeriesPointer_';     
  431.                                               
  432. // tODO        $g->getBrush()->setTransparency($this->getBrush()->getTransparency());
  433. // TODO        $g->getBrush()->setColor($colorValue->transparentColor($g->getBrush()->
  434. //                $this->getTransparency()));
  435.  
  436.         $this->xMinus = $px - $tmpHoriz;
  437.         $this->xPlus = $px + $tmpHoriz;
  438.         $this->yMinus = $py - $tmpVert;
  439.         $this->yPlus = $py + $tmpVert;
  440.  
  441.         if ($is3D) {
  442.             if ($aStyle == PointerStyle::$RECTANGLE) {
  443.                 if ($this->draw3D) {
  444.                     $g->cube($this->xMinus, $this->yMinus, $this->xPlus, $this->yPlus, $this->getStartZ(),
  445.                            $this->getEndZ(),
  446.                            $this->dark3D);
  447.                 } else {
  448.                     $g->rectangleWithZ(new Rectangle($this->xMinus, $this->yMinus, $this->xPlus + 1, $this->yPlus + 1),
  449.                                 $this->getStartZ());
  450.                 }
  451.             } else
  452.             if ($aStyle == PointerStyle::$CIRCLE) {
  453.                 if ($this->draw3D && $g->getSupportsFullRotation()) {
  454.                     $g->sphere($px, $py, $this->getMiddleZ(), $tmpHoriz);
  455.                 } else {
  456.                     $g->ellipse($this->xMinus, $this->yMinus, $this->xPlus, $this->yPlus, $this->getStartZ());
  457.                 }
  458.             } else
  459.             if ($aStyle == PointerStyle::$SPHERE) {
  460.                 $g->sphere(Rectangle::fromLTRB($this->xMinus, $this->yMinus, $this->xPlus, $this->yPlus),
  461.                          $this->getStartZ(), false);
  462.             } else
  463.             if ($aStyle == PointerStyle::$POLISHEDSPHERE) {
  464.                 $g->ellipse($this->xMinus, $this->yMinus, $this->xPlus, $this->yPlus, $this->getStartZ(), true);
  465.             } else
  466.             if ($aStyle == PointerStyle::$TRIANGLE) {
  467.                 $this->doTriangle3D($g, $tmpVert, $px, $py);
  468.             } else
  469.             if ($aStyle == PointerStyle::$DOWNTRIANGLE) {
  470.                 $this->doTriangle3D($g, -$tmpVert, $px, $py);
  471.             } else
  472.             if ($aStyle == PointerStyle::$LEFTTRIANGLE) {
  473.                 $this->doHorizTriangle3D($g, $tmpHoriz, $px, $py);
  474.             } else
  475.             if ($aStyle == PointerStyle::$RIGHTTRIANGLE) {
  476.                 $this->doHorizTriangle3D($g, -$tmpHoriz, $px, $py);
  477.             } else
  478.             if ($aStyle == PointerStyle::$CROSS) {
  479.                 $this->drawCross($g, true, $px, $py, $colorValue);
  480.             } else
  481.             if ($aStyle == PointerStyle::$DIAGCROSS) {
  482.                 $this->drawDiagonalCross($g, true, $colorValue);
  483.             } else
  484.             if ($aStyle == PointerStyle::$STAR) {
  485.                 $this->drawCross($g, true, $px, $py, $colorValue);
  486.                 $this->drawDiagonalCross($g, true, $colorValue);
  487.             } else
  488.             if ($aStyle == PointerStyle::$DIAMOND) {
  489.                 $g->plane(new TeePoint($this->xMinus, $py),
  490.                         new TeePoint($px, $this->yMinus),
  491.                         new TeePoint($this->xPlus, $py),
  492.                         new TeePoint($px, $this->yPlus), $this->getStartZ());
  493.             } else
  494.             if ($aStyle == PointerStyle::$SMALLDOT) {
  495.                 $g->setPixel($px, $py, $this->getMiddleZ(), $colorValue);
  496.             }
  497.         } else {
  498.             if ($aStyle == PointerStyle::$RECTANGLE) {
  499.                 $g->rectangle(new Rectangle($this->xMinus, $this->yMinus, ($tmpHoriz*2) + 1, ($tmpVert*2) + 1));
  500.             } else
  501.             if ($aStyle == PointerStyle::$CIRCLE) {
  502.                 $g->ellipse($this->xMinus, $this->yMinus, $this->xPlus, $this->yPlus);
  503. //                $g->ellipse($px, $py, $tmpHoriz, $tmpVert);
  504.             } else
  505.             if ($aStyle == PointerStyle::$SPHERE) {
  506.                 $g->sphere($this->xMinus, $this->yMinus, $this->xPlus, $this->yPlus, true);
  507.             } else
  508.             if ($aStyle == PointerStyle::$POLISHEDSPHERE) {
  509.                 $g->ellipse($this->xMinus, $this->yMinus, $this->xPlus, $this->yPlus, true);
  510.             } else
  511.             if ($aStyle == PointerStyle::$TRIANGLE) {
  512.                 $p = Array(new TeePoint($this->xMinus, $this->yPlus),
  513.                             new TeePoint($this->xPlus, $this->yPlus),
  514.                             new TeePoint($px, $this->yMinus));
  515.                 $g->polygon($p);
  516.             } else
  517.             if ($aStyle == PointerStyle::$DOWNTRIANGLE) {
  518.                 $p = Array(new TeePoint($this->xMinus, $this->yMinus),
  519.                             new TeePoint($this->xPlus, $this->yMinus),
  520.                             new TeePoint($px, $this->yPlus));
  521.                 $g->polygon($p);
  522.             } else
  523.             if ($aStyle == PointerStyle::$LEFTTRIANGLE) {
  524.                 $p = Array(new TeePoint($this->xMinus, $py),
  525.                             new TeePoint($this->xPlus, $this->yMinus),
  526.                             new TeePoint($this->xPlus, $this->yPlus));
  527.                 $g->polygon($p);
  528.             } else
  529.             if ($aStyle == PointerStyle::$RIGHTTRIANGLE) {
  530.                 $p = Array(new TeePoint($this->xMinus, $this->yMinus),
  531.                             new TeePoint($this->xMinus, $this->yPlus),
  532.                             new TeePoint($this->xPlus, $py));
  533.                 $g->polygon($p); 
  534.             } else
  535.             if ($aStyle == PointerStyle::$CROSS) {
  536.                 $this->drawCross($g, false, $px, $py, $colorValue);                
  537.             } else
  538.             if ($aStyle == PointerStyle::$DIAGCROSS) {
  539.                 $this->drawDiagonalCross($g, false, $colorValue);
  540.             } else
  541.             if ($aStyle == PointerStyle::$STAR) {
  542.                 $this->drawCross($g, false, $px, $py, $colorValue);
  543.                 $this->drawDiagonalCross($g, false, $colorValue);
  544.             } else
  545.             if ($aStyle == PointerStyle::$DIAMOND) {
  546.                 $p = Array(new TeePoint($this->xMinus, $py),
  547.                             new TeePoint($px, $this->yMinus),
  548.                             new TeePoint($this->xPlus, $py),
  549.                             new TeePoint($px, $this->yPlus));
  550.                 $g->polygon($p);
  551.             } else
  552.             if ($aStyle == PointerStyle::$SMALLDOT) {
  553.                 $g->setPixel($px, $py, $this->getMiddleZ(), $colorValue);
  554.             }
  555.         }
  556.         
  557.         TChart::$controlName=$old_name;
  558.     }
  559.  
  560.     public function draw($px, $py, $colorValue, $aStyle=0) {
  561.         $this->intDraw($this->chart->getGraphics3D(), $this->chart->getAspect()->getView3D(), $px, $py,
  562.              $this->horizSize,
  563.              $this->vertSize,
  564.              $colorValue, $aStyle);
  565.     }
  566.  
  567.     public /* todo review protected*/ function prepareCanvas($g, $colorValue) {
  568.         $g->setPen($this->getPen());
  569.         $tmpColor = new Color(0,0,0); // Todo TransparentColor
  570.         if ($this->pen->getColor()->isEmpty() || $colorValue == $tmpColor) {
  571.             $g->getPen()->setColor($colorValue);
  572.         }
  573.         $g->setBrush($this->getBrush());
  574.  
  575.         if ($this->bBrush->getColor()->isEmpty()) {
  576.             $g->getBrush()->setForegroundColor($this->bBrush->getSolid() ? $colorValue :
  577.                                             Color::BLACK());
  578.             $g->getBrush()->setColor($colorValue);
  579.         } else if ($this->series != null) {
  580.             if ($this->series->getColorEach() || $colorValue == Color::TRANSPARENT()) {
  581.                 $g->getBrush()->setColor($colorValue);
  582.             } else {
  583.                 $g->getBrush()->setColor($this->bBrush->getColor());
  584.             }
  585.         } else {
  586.             $g->getBrush()->setColor($colorValue);
  587.         }
  588.     }
  589.  
  590.         /**
  591.           * Pen used to draw a frame around Series Pointers.
  592.           *
  593.           * @return ChartPen 
  594.           */
  595.     public function getPen() {
  596.         if ($this->pen == null) {
  597.             $tmpColor = new Color(0,0,0);
  598.             $this->pen = new ChartPen($this->chart, $tmpColor);
  599.         }
  600.         return $this->pen;
  601.     }
  602.  
  603.         /**
  604.           * Brush used to fill Series Pointers.
  605.           *
  606.           * @return ChartBrush 
  607.           */
  608.     public function getBrush() {
  609.         if ($this->bBrush == null) {
  610.             $this->bBrush = new ChartBrush($this->chart);
  611.             if ($this->series != null) {
  612.                 $this->bBrush->setColor($this->series->getColor());
  613.             }
  614.         }
  615.         return $this->bBrush;
  616.     }
  617.  
  618. /* TODO
  619.     protected function drawLegendShape($color, $rect, $drawPen) {
  620.         $this->drawLegendShape($this->chart->getGraphics3D(), $color, $rect, $drawPen);
  621.     }
  622. */
  623.  
  624.     /* todo check why protected*/ public function drawLegendShape($g, $color, $rect, $drawPen) {
  625.         $tmpHoriz=0;
  626.         $tmpVert=0;
  627.  
  628.         $this->prepareCanvas($g, $color);
  629.  
  630.         if ($drawPen) {
  631.             $tmpHoriz = $rect->width / 3;
  632.             $tmpVert = $rect->height / 3;
  633.         } else {
  634.             $tmpHoriz = 1 + ($rect->width / 2);
  635.             $tmpVert = 1 + ($rect->height / 2);
  636.         }
  637.  
  638.        $this->intDraw($g, false, ($rect->x + $rect->getRight()) / 2,
  639.              ($rect->y + $rect->getBottom()) / 2,
  640.              min($this->horizSize, $tmpHoriz),
  641.              min($this->vertSize, $tmpVert), $color, $this->style);
  642.  
  643.     }
  644.  
  645.      /*todo check  why protected*/ public function calcHorizMargins($margins) {
  646.         if ($this->bVisible && $this->inflate) {
  647.             $margins->min = max($margins->min, $this->horizSize + 1);
  648.             $margins->max = max($margins->max, $this->horizSize + 1);
  649.         }
  650.     }
  651.  
  652.     /*todo check  why protected*/ public function calcVerticalMargins($margins) {
  653.         if ($this->bVisible && $this->inflate) {
  654.             $margins->min = max($margins->min, $this->vertSize + 1);
  655.             $margins->max = max($margins->max, $this->vertSize + 1);
  656.         }
  657.     }
  658.  
  659.         function setDefaultVisible($value) {
  660.                 $this->defaultVisible = $value;
  661.                 $this->bVisible = $value;
  662.         }
  663. }
  664.  
  665. ?>

Documentation generated on Wed, 16 Jun 2010 12:08:05 +0200 by phpDocumentor 1.4.1